<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style type="text/css">
    table {
      table-layout: fixed;
      width: 100%;
      border-top: 1px solid #e0e0e0;
      border-left: 1px solid #e0e0e0;
    }
    th {
      width: 120px;
    }
    th, td {
      text-align: center;
      border-right: 1px solid #e0e0e0;
      border-bottom: 1px solid #e0e0e0;
    }
  </style>
</head>
<body>
  <h1>{{title}}</h1>
  <button id="exportBtn" style="margin-bottom: 10px">导出Excel</button>
  <table>
    <thead>
    <tr>
      {{#each dates}}
        <th>{{this}}</th>
      {{/each}}
    </tr>
    </thead>
    <tbody>
    <tr>
      {{#each values}}
        <td>{{this}}</td>
      {{/each}}
    </tr>
    </tbody>
  </table>
  <script>
    document.querySelector('#exportBtn').addEventListener('click', function () {
      window.open('/download');
    }, false)
  </script>
</body>
</html>
